#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
    FILE *p;
    int ch;
    unsigned long count = 0;
    if (argc != 2) {
        printf("No name!\n");
        exit(EXIT_FAILURE);
    }
    if ((p = fopen(argv[1], "r")) == NULL) {
        printf("open file fail\n");
        exit(EXIT_FAILURE);
    }
    while ((ch = getc(p)) != EOF) {
        putc(ch, stdout);
        count++;
    }
    fclose(p);
    printf("character number %lu\n", count);
    return 0;
}